<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>

  <style>
    #app {
      width: 300px;
      height: 300px;
      border: 1px solid #000
    }
  </style>
</head>

<body>
  <div id="app"></div>
  <script>
    const oApp = document.querySelector('#app')
    function enter() {
      // console.log(111);
      this.style.background = 'red'
    }
    function leave() {
      // console.log(111);
      this.style.background = ''
    }
    oApp.onmouseenter = _.throttle(enter, 1000,{leading:false,trailing:true})
    oApp.onmouseleave = leave
  </script>
</body>

</html>